/****************************************************************************
    Copyright 2009 Clark Scheff
    
    This file is part of Boulder Crush.

    Boulder Crush is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
    the Free Software Foundation version 3 of the License.

    Boulder Crush is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU General Public License for more details.

    You should have received a copy of the GNU General Public License
    along with Boulder Crush.  If not, see <http://www.gnu.org/licenses/>.
****************************************************************************/

package com.scheffsblend.boulder.crash;

public class Boulder {
	public final static int MIN_RADIUS = 10;
	public final static int MAX_RADIUS = 60;
	public final static int MIN_VELOCITY = 10;
	public final static int MAX_VELOCITY = 20;
	
	private float mRadius = MIN_RADIUS;
	private Point mPosition = new Point();
	private Point mVelocity = new Point();
//	private Point mInitialPosition = new Point();
//	private Point mInitialVelocity = new Point();
	
	public boolean setRadius(float r) {
		if(r < MIN_RADIUS || r > MAX_RADIUS)
			return false;
		mRadius = r;
		return true;
	}
	
	public void setPosition(float x, float y) {
		mPosition.x = x;
		mPosition.y = y;
	}
	
	public void setVelocity(float vx, float vy) {
		mVelocity.x = vx;
		mVelocity.y = vy;
	}
	
	public float getRadius() {
		return mRadius;
	}
	
	public Point getPosition() {
		return mPosition;
	}
	
	public Point getVelocity() {
		return mVelocity;
	}
	
	public void move() {
		mVelocity.y += 0.5f;
		mPosition.x += mVelocity.x*0.5f;
		mPosition.y += mVelocity.y*0.5f;
	}
}
